package com.bluesky.plum.validate.validator;

/**
 * target must be string.
 * 
 * @author hz00260
 * 
 */
public class RegExpValidator extends Validator {
	private String regexp;

	public RegExpValidator() {

	}

	public RegExpValidator(String regexp) {
		this.regexp = regexp;
	}

	public String getRegexp() {
		return regexp;
	}

	public void setRegexp(String regexp) {
		this.regexp = regexp;
	}

	@Override
	public void validate() {
		String s = (String) target;
		result = s.matches(regexp);

	}
}
